<template>
    <div class="homeSearch" v-if="isHome">
        <Input class="search" v-model="searchKey" @keydown.native.enter.prevent="queryInfo" prefix="ios-search"
               placeholder="客户姓名/单号" clearable/>
    </div>
</template>
<script>
export default {
    name: 'HomeSearch',
    data() {
        return {
            searchKey: ''
        }
    },
    computed: {
        isHome() {
            return this.$route.name === 'home_index'
        },
    },
    mounted() {
    },
    beforeDestroy() {
    },
    methods: {
        //根据客户姓名，单号，手机号查询订单及放款信息
        queryInfo() {
            console.log(this.$route)
            let params = {
                key: this.searchKey,
                flag: "home"
            }
            this.afs.newTab(this, 'projects/afs-apply/pages/others/order-lending-manage/orderLendingMng', '订单查询结果', 'ios-add',
                {params}, 'orderLeadingMng' + this.searchKey, [], true);
        },
    },

}
</script>
<style lang="less" scoped>
.homeSearch {
    .search {
        width: 32px;
        height: 32px;
        transition: all .5s linear;

        &:hover {
            width: 200px;

            /deep/ .ivu-input {
                border-color: #D8D8D8;
            }

            /deep/ .ivu-icon-ios-search {
                font-size: 14px;
            }

            /deep/ .ivu-input-small {
                padding-right: 7px;
            }
        }

        /deep/ .ivu-input {
            border-color: transparent;
        }

        /deep/ .ivu-icon-ios-search {
            transition: all .5s linear;
            font-size: 24px;
        }

        /deep/ .ivu-input-small {
            padding-right: 0;
        }
        /deep/ .ivu-input:focus {
            box-shadow: none;
        }
    }
}
</style>
